
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}
body {
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    background-color: black;
}
.title {
    text-align: center;
    margin-top: 50vh;
    transform: translateY(-50%);
    font-size: 30px;
    color: aliceblue;
    text-shadow: 0 -10px 10px rgba( 255, 255, 255, 0.4);
}
@function getRandomRain($n) {
    $shadowString: '';
    // $shadowString: '#{random(1000) / 10}vh #{random(1000) / 10}vw 0 rgba(255, 255, 255, 0.7)';
    @for $i from 1 through $n {
        // $shadowString: '#{$shadowString}, #{random(1000) / 10}vw #{random(1000) / 10}vh 0 rgba(255, 255, 255, 0.7)';
        @if $i == 1 {
            $shadowString: '#{random(1000) / 10}vw #{random(1000) / 10}vh 3px rgba(255, 255, 255, 0.7)';
        } @else {
            $shadowString: '#{$shadowString}, #{random(1000) / 10}vw #{random(1000) / 10}vh 0 rgba(255, 255, 255, 0.7)';
        }
    }
    @return unquote($shadowString);
}
$speed: 10;
$opacity: 0.9;
@for $i from 1 through 5 {
   .rain-index-#{$i} {
        $size: 4px;
        $boxShadow: getRandomRain(500);
        $speed: floor($speed * 1.25);
        $opacity: $opacity - 0.1;

        position: relative;
        top: 0;
        left: 0;
        width: $size;
        height: $size;
        border-radius: $size;
        background-color: #fff;
        opacity: $opacity;
        box-shadow: $boxShadow;
        animation: loopBottom #{$speed}s linear infinite;
        
        &::before {
            display: block;
            content: '';
            width: $size;
            height: $size;
            border-radius: $size;
            background-color: #fff;
            transform: translateY(-100vh);
            box-shadow: $boxShadow;
        }
    }
}
@keyframes loopBottom {
    0% {
        transform: translateY(0);
    }
    100% {
        transform: translateY(100vh);
    }
}